//
//  Weather.m
//  Lesson
//
//  Created by centling on 15/4/21.
//  Copyright (c) 2015年 Seas.CHENG. All rights reserved.
//

#import "Weather.h"

@implementation Weather

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{@"error":@"error",
             @"status":@"status",
             @"date":@"date",
             @"results":@"results",
             };
};


+ (NSValueTransformer *)resultsJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[Result class]];
}
@end





@implementation Result
#pragma mark - JSON serialization

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{@"currentCity":@"currentCity",
             @"pm25":@"pm25",
             @"index":@"index",
             @"weather_data":@"weather_data",
             };
}

+ (NSValueTransformer *)indexJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[Index class]];
}

+ (NSValueTransformer *)weather_dataJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[Data class]];
}

@end


@implementation Index
#pragma mark - JSON serialization

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{@"title":@"title",
             @"zs":@"zs",
             @"tipt":@"tipt",
             @"des":@"des",
             };
}

@end


@implementation Data
#pragma mark - JSON serialization

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{@"date":@"date",
             @"dayPictureUrl":@"dayPictureUrl",
             @"nightPictureUrl":@"nightPictureUrl",
             @"weather":@"weather",
             @"wind":@"wind",
             @"temperature":@"temperature",
             };
}

@end

